<template>
  <div class="item" @click="handleClick(item.id)">
    <img :src="item.cover" class="logo" />
    <p class="one">{{ item.name }}</p>
  </div>
</template>

<script>
export default {
  props: {
    item: {
      type: Object,
    },
  },
  methods: {
    handleClick(id) {
        console.log(this);
      var musics = this.$parent.musics;
      var index = musics.findIndex((item) => item.id == id);
      musics.splice(index, 1);
    },
  },
};
</script>

<style scoped>
.item {
  width: 110px;
  border: 1px solid #333;
}
.logo {
  width: 100px;
  height: 100px;
}
</style>